package com.beiding;

import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.connection.MessageListener;
import org.springframework.stereotype.Component;

@Component
public class RL implements MessageListener {
    @Override
    public void onMessage(Message message, byte[] pattern) {

        byte[] body = message.getBody();

        byte[] channel = message.getChannel();
        String topic = new String(channel);
        String itemValue = new String(body);
        // 请参考配置文件，本例中key，value的序列化方式均为string。
        System.out.println("topic:"+topic);
        System.out.println("itemValue:"+itemValue);


    }
}
